using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

public class GridData : MonoBehaviour
{
    public string Id;
    public float X;
    public float Y;
    public float Width;
    public float Height;
    public GridState State;
    public bool IsAnchorCenter;

    public void Draw()
    {
        var col = new Color(78 / 255f, 97 / 255f, 125 / 255f);
        if (State == GridState.UnWalkable)
        {
            col = new Color(62 / 255f, 78 / 255f, 101 / 255f);
        }

        float y = 10;
        float h_w = Width / 2;
        float h_h = Height / 2;

        Vector3[] rectangleVertices = new Vector3[]
        {
            new Vector3(X - h_w, y, Y - h_h), // Bottom left corner
            new Vector3(X + h_w, y, Y - h_h), // Bottom right corner
            new Vector3(X + h_w, y, Y + h_h), // Top right corner
            new Vector3(X - h_w, y, Y + h_h) // Top left corner
        };
        
        Handles.DrawSolidRectangleWithOutline(rectangleVertices,col,col);
    }
}

public enum GridState
{
    Walkable,
    UnWalkable,
}